package com.bugpool.leilema.tc.bean.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bugpool.leilema.tc.bean.interfaces.TreeFeature;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @Author wh
 * @Description 系统部门
 * @Date 2023/6/8 9:28
 * @Version 1.0
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("tb_sys_dept")
public class SysDept extends BaseEntity implements Serializable, TreeFeature<SysDept> {

    @ApiModelProperty("部门id")
    @TableId(type = IdType.ASSIGN_ID)
    private Long deptId;

    @ApiModelProperty("部门父级id")
    private Long parentId;

    @ApiModelProperty("部门名称")
    private String deptName;

    @ApiModelProperty("祖级列表")
    private String ancestors;

    @ApiModelProperty("负责人")
    private String leader;

    @ApiModelProperty("顺序")
    private Long orderNum;

    @ApiModelProperty("手机号")
    private String phone;

    @ApiModelProperty("状态")
    private Boolean status;

    @ApiModelProperty("子类集合")
    @TableField(exist = false)
    private List<SysDept> childrenList;

    @Override
    public Long getNodeId() {
        return this.deptId;
    }

    @Override
    public void setChildrenList(List<SysDept> childrenList) {
         this.childrenList=childrenList;
    }

    @Override
    public Long getOrder() {
        return this.orderNum;
    }


}
